

-record(cus_user, {uid,
                  muteNotofication = 0,                            %% 全局免打扰(0:关,1:开)
                  pushContent = 0,                                 %% 推送内容拦截设置(0:不拦截,1:拦截)
                  platform = "",                                   %% 平台(ios,android)
                  pushKey = "",                                    %% 推送key
                  blacks = [],                                     %% 黑名单列表
                  alias = [],                                      %% 别名列表
                  follows = [],                                    %% 特别关注会话列表
                  emotions = [],                                   %% 自定义表情列表
                  latelyEmotions = [],                             %% 常用表情列表
                  muteNotofications = [],                          %% 免打扰会话列表
                  sticks = [],                                     %% 置顶会话列表
                  conversations = [],                              %% 会话列表
                  lastTime = 0,                                    %% 本次登陆时间
                  resv1 = [],                                      %% 备用字段1
                  resv2 = [],                                      %% 备用字段2
                  resv3 = []}).                                    %% 备用字段3


%%会话:会话id, 会话名称, 会话成员, 当前序号, 会话状态(1:正常,0:解散)
-record(cus_conversation, {cid,
                           name = "",
                           members = [],
                           seq = 0,
                           status = 1,
                           updateTime = cus_util:utc_str(),
                           resv1 = [],
                           resv2 = [],
                           resv3 = []}).


-record(msg, {mid, conversationid, conversationinfo, msgtype, fromuser, members, content, msgtime, msgstatus}).

%%系统表情包
-record(cus_sys_emotion_packet, {id="",
                                name="",
                                displayOrder="",
                                directory = "",
                                available="",
                                cover="",
                                code="",
                                detail="",
                                emotions=""}).


%%系统表情
-record(cus_sys_emotion, {name="",
                          displayOrder="",
                          fileName="",
                          code="",
                          available="",
                          url="",
                          urlJpg=""}).





-define(QUANLIAO, "1").

-define(TAOLUNZU, "2").

-define(DANLIAO, "3").


-define(IV, <<"1111111111111111">>).

-define(RESOURCE, <<"111111111">>).

-define(SERVER, <<"xiaoquan.com">>).

-define(COOKIE_TIME, 1800).

-define(PAGE_SIZE, 10).

-define(ACCESS_KEY, "1hrdGBggkcLmO0+RKZj5").
-define(SECRET_KEY, "yppzHFoTG71uQAGaGFXSBAUnb+OPNgkARfMIpw+9").
-define(BUCKET_NAME, "im002").

%%-define(ACCESS_KEY, "OFA0H3pPhKv1UriWOXti").
%%-define(SECRET_KEY, "xN9CXTyWKiyZN9bGwYWZDR7HCTipsxT87EoRM6YR").
%%-define(BUCKET_NAME, "haibang").
-define(ACL, "public-read").




%% 消息类型
-define(TEXT,    "text").                           %% 文本
-define(IMG,     "img").                            %% 图片
-define(VOICE,   "voice").                          %% 语音
-define(CC,      "create_conversation").            %% 加入会话
-define(DC,      "disband_conversation").           %% 解散会话
-define(UATC,    "user_add_to_conversation").       %% 用户加入会话
-define(UETC,    "user_exit_to_conversation").      %% 用户退出会话
-define(URM,     "user_revert_message").            %% 用户撤销消息

-define(IF(Condition, A, B), case catch Condition of true -> A; _ -> B end).

-define(list(X), cus_util:to_list(X)).

-define(l2b(X), list_to_binary(X)).

-define(b2l(X), case X of undefined -> ""; _ -> binary_to_list(X) end).

-define(i2l(X), integer_to_list(X)).

-define(l2i(X), list_to_integer(X)).

-define(l2atom(X), list_to_atom(X)).

-define(l2tuple(X), list_to_tuple(X)).

-define(member(X, L), lists:member(X, L)).

-define(param(K, L), ?b2l(proplists:get_value(K, L, <<>>))).

-define(before(DateTime, H), calendar:gregorian_seconds_to_datetime(calendar:datetime_to_gregorian_seconds(DateTime)-60*60*H)).
